/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2023. All rights reserved.
 */

package common

// productionList 返回体
type ProductionList struct {
	Productions []Productions `json:"productions"`
	TitalCount  int           `json:"totalCount"`
}
type Productions struct {
	Production []Production `json:"production"`
	TitleName  string       `json:"titleName"`
	Size       int          `json:"size"`
}
type Production struct {
	ProductionId   string  `json:"productionId"`
	ProductionType string  `json:"productionType"`
	TitleName      string  `json:"titleName"`
	ProductionName string  `json:"productionName"`
	IframeURL      string  `json:"iframeURL"`
	Currency       string  `json:"currency"`
	Price          float64 `json:"price"`
}

type Category struct {
	CategoryId   int    `json:"categoryId"`
	CategoryName string `json:"categoryName"`
}

// UserInfo 通过网关获取的两个id只使用了一个
type UserInfo struct {
	Uid string `json:"uid"`
}

type User struct {
	UserId        string `json:"id"`
	UserName      string `json:"userName"`
	Locked        bool   `json:"locked"`
	Role          string `json:"role"`
	Authenticated bool   `json:"authenticated"`
}

type LoginResp struct {
	UserName      string `json:"userName"`
	UserId        string `json:"userId"`
	Role          string `json:"role"`
	PwdChanged    bool   `json:"pwdChanged"`
	Authenticated bool   `json:"authenticated"`
}

type Profile struct {
	Name            string `json:"userName"`
	Address         string `json:"address"`
	CreatedTime     int64  `json:"createdTime"`
	Authenticated   bool   `json:"authenticated"`
	RegPhoneNum     string `json:"regPhoneNum"`
	ProfilePhotoUrl string `json:"profilePhotoUrl"`
}

type CheckPhoneRegResp struct {
	PhoneReg bool `json:"phoneReg"`
}

type UserList struct {
	PageNum      int     `json:"PageNum"`
	PageSize     int     `json:"pageSize"`
	TotalPageNum int     `json:"totalPageNum"`
	TotalNum     int     `json:"totalNum"`
	UserList     []*User `json:"userLists"`
}

type FileResponse struct {
	ObsKey string `json:"obsKey"`
}

type FileUrlResponse struct {
	FileUrl string `json:"FileUrl"`
}

type RealNameAuthenticationResp struct {
	Name               string `json:"userName"`
	VerificationCode   string `json:"verificationName"`
	VerificationResult string `json:"verificationID"`
	VerificationMsg    string `json:"verificationMsg"`
}
type GetProfilePhoto struct {
	ProfilePhotoUrl string `json:"FileUrl"`
}

type BalanceQueryResponse struct {
	UserId string `json:"userId"`
	// 用户欠款总额度
	DebtAmount float64 `json:"debtAmount"`
	// 用户可用总额度
	Amount float64 `json:"amount"`
	// 币种 CNY人民币
	Currency string `json:"currency,omitempty"`
}

type BalanceChangeRecordQueryResponse struct {
	UserId       string                 `json:"userId"`
	ChangeRecord []BalanceChangreRecord `json:"changeRecord"`
	Size         int                    `json:"size"`
	TotalCount   int                    `json:"totalCount"`
}
type BalanceChangreRecord struct {
	OperationType   int     `json:"operationType"`
	OperationTime   string  `json:"operationTime"`
	BalanceRecordId string  `json:"balanceRecordId"`
	Amount          float64 `json:"amount"`
	PaymentMethod   string  `json:"paymentMethod"`
}

type CreditQueryResponse struct {
	UserId string `json:"userId"`
	// 用户欠款总额度
	DebtAmount float64 `json:"debtAmount"`
	// 用户可用总额度
	Amount float64 `json:"amount"`
	// 币种 CNY人民币
	Currency string `json:"currency"`
	//信用额度到期时间
	ExpireTime string `json:"expireTime"`
}

// 包周期订单
type OnePayOrderInfo struct {
	UserId              string  `json:"userId"`
	OrderId             string  `json:"orderId"`
	OrderStatus         int32   `json:"orderStatus"`
	OrderType           int32   `json:"orderType"`
	CreatedTime         string  `json:"createdTime"`
	PaymentTime         string  `json:"paymentTime"`
	OrderExpiredTime    string  `json:"orderExpiredTime"`
	ResourceExpiredTime string  `json:"resourceExpiredTime"`
	Price               float64 `json:"price"`
	ServiceTypeName     string  `json:"serviceTypeName"`
	ProductionSpecDesc  string  `json:"productionSpecDesc"`
}

type OrderOnePayQueryResponse struct {
	Order      []OnePayOrderInfo `json:"order"`
	Size       int               `json:"size"`
	TotalCount int               `json:"totalCount"`
}

// 按需订单
type OnDemandOrderInfo struct {
	UserId               string `json:"userId"`
	OrderId              string `json:"orderId"`
	OrderStatus          int32  `json:"orderStatus"`
	OrderType            int32  `json:"orderType"`
	CreatedTime          string `json:"createdTime"`
	ServiceTypeName      string `json:"serviceTypeName"`
	RegionCode           string `json:"regionCode"`
	AvailabilityZoneCode string `json:"availabilityZoneCode"`
	ProductSpecDesc      string `json:"productSpecDesc"`
}

type OrderOnDemandQueryResponse struct {
	Order      []OnDemandOrderInfo `json:"onDemandOrder"`
	Size       int                 `json:"size"`
	TotalCount int                 `json:"totalCount"`
}

// 用户账单
// tradeId和platformType对普通用户隐藏
type BillCommonInfo struct {
	UserId                 string  `json:"userId"`
	BillCycle              string  `json:"billCycle"`
	BillId                 string  `json:"bid"`
	OrderId                string  `json:"orderId"`
	ServiceTypeName        string  `json:"serviceTypeName"`
	ResourceTypeName       string  `json:"resourceTypeName"`
	RegionName             string  `json:"regionName"`
	ChargeMode             string  `json:"chargeMode"`
	EffectiveTime          string  `json:"effectiveTime"`
	ExpireTime             string  `json:"expireTime"`
	TradeTime              string  `json:"tradeTime"`
	BillType               int32   `json:"billType"`
	BillStatus             int32   `json:"billStatus"`
	OfficialAmount         float64 `json:"officialAmount"`
	OfficialDiscountAmount float64 `json:"officialDiscountAmount"`
	EraseAmount            float64 `json:"eraseAmount"`
	ConsumeAmount          float64 `json:"consumeAmount"`
	CashAmount             float64 `json:"cashAmount"`
	CreditAmount           float64 `json:"creditAmount"`
	CouponAmount           float64 `json:"couponAmount"`
	DebtAmount             float64 `json:"debtAmount"`
}
type UserBillAllInfo struct {
	PlatformType    string `json:"platformType"`
	TradeId         string `json:"tradeId"`
	CloudResourceId string `json:"cloudResourceId"`
	Billinfo        BillCommonInfo
}
type CommonUserBillQueryResponse struct {
	Bill       []BillCommonInfo `json:"billInfo"`
	Size       int              `json:"size"`
	TotalCount int              `json:"totalCount"`
	Currency   string           `json:"currency"`
}
type AdminUserBillQueryResponse struct {
	Bill       []UserBillAllInfo `json:"bill"`
	Size       int               `json:"size"`
	TotalCount int               `json:"totalCount"`
	Currency   string            `json:"currency"`
}

// /////////////////////////////////////////////////////////////////////////

type PaymentInfo struct {
	CodeUrl string `json:"codeUrl"`
}

type OrderResponse struct {
	OrderId         string  `json:"orderId"`
	CollectionIndex string  `json:"collectionIndex"`
	TokenId         string  `json:"tokenId"`
	OrderStatus     string  `json:"orderStatus"`
	CreatedTime     int64   `json:"createdTime"`
	ExpiredTime     int64   `json:"expireTime"`
	Currency        string  `json:"currency"`
	Price           float64 `json:"price"`
}

type PhoneVerifyResp struct {
	CooldownTime int64 `json:"cooldownTime"`
}

type RegistrationResp struct {
	UserName    string `json:"userName"`
	PhoneNumber string `json:"phoneNumber"`
}
